package com;

import com.demo.Controller.UserAdviceController;
import com.demo.Controller.UserController;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created with IntelliJ IEDA.
 * Description:
 * User:86186
 * Date:2023-05-25
 * Time:22:24
 */
public class APP {
    public static void main(String[] args) {
        //1.获取上下文对象
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring-config.xml");

        //2.获取 Bean
        UserController userController = applicationContext.getBean("userController",UserController.class);
        userController.getUser();

        UserAdviceController userAdviceController = applicationContext.getBean("userAdviceController",UserAdviceController.class);
        userAdviceController.getUser();
    }
}
